<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>

<%@ include file="/core/taglibs.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<%@ include file="/core/memberMeta.jsp"%>
<script src="<%=basePath%>/resources/memberCss/assets/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
		 
		
		function loginNameChange(){
			
			var loginName=$("#loginName").val(); 	
			 
			$.getJSON("<%=basePath%>/member/wealth/ajaxGetPersonByloginName.shtml",{loginName: loginName},function(result){	 
			 
				//填入新值
				if(result.success==true){
					
					$("#loginNamePersonName").html("代理商编号正确，代理商姓名:"+result.personName);
				}else{
					 
					$("#loginNamePersonName").html("<b  style='color: red;'>代理商编号不正确，代理商不存在</b>");
				} 
				
				 
			});
			 
			
		}
	</script>
<script type="text/javascript"> 
		$(function() {
		    $('#submit').click(function() {
		    	var checkSubmitFlg = true; 
		    
		    	if(checkSubmitFlg==true){
		    		
		    		var this_ = this;
			    	this_.setAttribute("disabled", true);  
			    	this_.value="请稍等，提交中...";  
			        $.ajax({
			            url: '<%=basePath%>/member/wealth/pay.shtml',
			            type: 'post',
			            dataType:'json',
			            data: $("#commitForm").serializeArray(),
			            success: function(result) {
			            	 if(result.success==true){
			            	 	 alert("恭喜您，转账成功。");
			            	 	
			            	 	window.location.href="<%=basePath%>/member/wealth/logEleList.shtml";

								} else {
									alert("转账失败。" + result.msg);
									location.reload();//刷新页面   
								}

												//放到回调里
												this_
														.removeAttribute("disabled");
												this_.value = "提  交";
											}
										});

							}

						});
	});
</script>
</head>



<body>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/theme.js"></script>
	<div class="page-heading">
		<h3>资金管理</h3>
		<ul class="breadcrumb">
			<li>资金管理</li>
			<li class="active">购物积分转账</li>
		</ul>
	</div>
	<section class="wrapper">
		<div class="row">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading">购物积分转账</header>
					<div class="panel-body">
						<form id="commitForm" class="form-horizontal adminex-form" method="post">
							<input type="hidden" name="token" value="${token}" />
							<div class="form-group">
								<label class="col-sm-2 col-sm-2 control-label">我的购物积分：</label>
								<div class="col-sm-10">${member.ele}</div>
							</div>

							<div class="form-group">
								<label class="col-sm-2 col-sm-2 control-label">接受代理商：</label>
								<div class="col-sm-10">
									<input type="text" id="loginName" name="loginName" onchange="loginNameChange()" placeholder="请输入接收代理商账户" class="form-control m-bot15" /> <span id="loginNamePersonName"></span>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 col-sm-2 control-label">转账信息：</label>
								<div class="col-sm-10">
									${paramWage1024}起，${paramWage1025}倍数<br />
								</div>
							</div>

							<div class="form-group">
								<label class="col-sm-2 col-sm-2 control-label">转账数量：</label>
								<div class="col-sm-10">
									<input type="text" id="num" name="num" placeholder="请输入数量" class="form-control m-bot15" />
								</div>
							</div>


							<div class="form-group">
								<label class="col-sm-2 col-sm-2 control-label">安全密码：</label>
								<div class="col-sm-10">
									<input type="password" id="myTwoPassword" name="myTwoPassword" class="form-control m-bot15" />
								</div>
							</div>

							<div class="form-group text-center">${retMsg}</div>

							<div class="form-group text-center">
								<button id="submit" name="submit" type="button" class="btn btn-primary">转账</button>
							</div>
						</form>
					</div>
				</section>
			</div>
		</div>
	</section>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/amazeui2.min.js"></script>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/amazeui.datatables.min.js"></script>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/dataTables.responsive.min.js"></script>
	<script src="<%=basePath%>/resources/memberCss2/assets/js/app.js"></script>
</body>

</html>






